﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace TCP_SocketDongbo
{
    class DnsGrabber:BaseGrabber
    {
        public override void GetNicConfig()
        {
            string hostname = Dns.GetHostName();
            Console.WriteLine("Localhost {0}", hostname);
            //Lay tat ca dia chi ip
            Console.WriteLine("Cach 1");
            IPAddress[] ipaddress = Dns.GetHostAddresses(hostname);
            foreach (IPAddress ip in ipaddress)
            {
                Console.WriteLine("Ip Address: {0}", ip);
            }
            //Console.WriteLine("Cach 2");
            ////Phan giai ten may hoac dia chi ip
            //IPHostEntry iphost = Dns.GetHostEntry(hostname);
            ////Xuat IP
            //foreach (IPAddress iph in iphost.AddressList)
            //{
            //    Console.WriteLine("Ip Address: {0}", iph);
            //}
        }
    }
}
